﻿using Bll.Corpus;
using ShareCode.Entity.Corpus;
using Infrastructure.Attributes.Ioc;
using Microsoft.AspNetCore.Mvc;
using ShareCode.Dto.User.Org.Admin;
using ShareCode.Dto;

namespace ApiApp.Controllers.Corpus
{
    /// <summary>
    /// by zhouxin
    /// action的 900 < SerialNumber < 1000
    ///</summary>
    [ApiController]
    [Route("Corpus/[controller]")]
    [Component(ServiceLifetime.Transient)]
    public class CorpusVersionController : BaseTreeController<CorpusVersionEntity>
    {
        protected override CorpusVersionBll? Bll => (CorpusVersionBll?)base.Bll;

        [Autowired]
        public CorpusVersionBll SetBll { set { this._Bll = value; } }

        [HttpPost("TreeInsertSonWithCover")]
        public async virtual Task<JsonResult> TreeInsertSonWithCover([FromForm] FileUploadDto<CorpusVersionEntity> entity)
        {
            return await OkkAsync(Bll!.TreeInsertSonWithCover(entity));
        }

        [HttpPost("UpdataWithCover")]
        public async virtual Task<JsonResult> UpdataWithCover([FromForm] FileUploadDto<CorpusVersionEntity> entity)
        {
            return await OkkAsync(Bll!.UpdataWithCover(entity));
        }
    }
}
